package com.lz.repository.xjl.impl;

import com.lz.entity.CarParts;
import com.lz.repository.xjl.CarPartsDao;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 徐建林
 * @date 2018/10/28 10:48
 */
@Repository
public class CarPartsDaoImpl implements CarPartsDao {
    @Autowired
    private SessionFactory sessionFactory;

    @Override
    public List<CarParts> getAllCarParts() {
        Session session = sessionFactory.openSession();
        List carPartsList = session.createQuery("from CarParts").list();
        return carPartsList;
    }

    @Override
    public void removeCarPart(Integer carPartsId, Integer carPartsCount) {

    }
}
